#include <net/if.h>
#include <stdio.h>
#include <errno.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
#include "../tinyxml/tinyxml.h"

#include "interface.h"


//extern "C"

extern int skfd;//, inet_sock, inet6_sock;
extern int sockets_open(int family);
//#include "sockets.h"

int opt_a = 0; /* show all interfaces          */
int opt_i = 0; /* show the statistics          */

int addr_family = 0; /* currently selected AF        */

int main(int argc, char **argv)
{
	/* Create a channel to the NET kernel. */
	if ((skfd = sockets_open(0)) < 0)
	{
		perror("socket");
		exit(1);
	}

	int err = for_all_interfaces(do_if_print);
	(void) close(skfd);
	exit(err < 0);
}
